package listbyorder.access101_200.test171;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/6/14 13:51
 */
public class Solution1 {

    public int titleToNumber(String s) {
        int ans = 0;
        int len = s.length();
        for (int i = 0; i < len; i++) {
            ans += Math.pow(26,i) * (s.charAt(len - 1 - i) - 'A' + 1);
        }
        return ans;
    }
}
